/**
* 系统管理 用户管理
*/
<template>
  <div>
    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: 'taskList' }">清洗结果任务展示</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: 'getResults?taskId='+this.$route.query.taskId }">清洗结果展示</el-breadcrumb-item>
      <el-breadcrumb-item>清洗结果详情</el-breadcrumb-item>
    </el-breadcrumb>
    <div style="padding:5px;color:#000000;text-align: center;font-family:PingFang SC;font-size:30px">清洗结果详情</div>


   <div style="padding:10px">
     <section>
       <el-table :show-header="false"
                 :data="ret"
                 border
                 :cell-style="columnStyle"
                 style="margin-top:20px;width: 100%;">
         <el-table-column align="center" width="120" class="my-column">
           <template slot-scope="scope">
             <h3>数据源内容</h3>
           </template>
         </el-table-column>
         <el-table-column align="center" prop="sourceContent"></el-table-column>

       </el-table>

     </section>
      <section style="margin-top: 10px">
        <el-table :show-header="false"
                  :data="ret"
                  border
                  :cell-style="columnStyle"
                  style="margin-top:20px;width: 100%;">
          <el-table-column align="center" width="120" class="my-column">
            <template slot-scope="scope">
              <h3>清洗结果</h3>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="resultContent"></el-table-column>

        </el-table>

      </section>
   </div>




  </div>
</template>

<script>
  // 导入请求方法
  import {
    userList,
    userSave,
    userDelete,
    userPwd,
    userExpireToken,
    userFlashCache,
    userLock,
    UserDeptTree,
    UserDeptSave,
    UserDeptdeptTree,
    UserChangeDept
  } from '../../api/userMG'
  import Pagination from '../../components/Pagination'
  import axios from "axios";
  export default {
    data() {
      return {
        loading: false, //是显示加载


        obj:[{id:'',taskName:""}],
        ret:"",
        // 请求数据参数
        formInline: {
          page: 1,
          id:this.$route.query.id,
          taskId:this.$route.query.taskId,
          limit: 10,
          source_id: '',
          // sourceType:this.$route.query.sourceType
        },
        //结果数据
        result:"",
        //任务数据
        taskData:[],
        // 数据源信息
        modelDataSource1:[],

        // 文件内容
        fileContent:"",
        sourceContent:"",
        algorithmId:"",
        resultContent:"",
        ll:[],
        //错误消息
        error:[],
        // 分页参数
        pageparm: {
          currentPage: 1,
          pageSize: 10,
          total: 10
        }
      }
    },
    // 注册组件
    components: {
      Pagination
    },

    /**
     * 数据发生改变
     */
    watch: {},

    /**
     * 创建完毕
     */
    created() {
      this.getSearchPage()

    },

    /**
     * 里面的方法只有被调用才会执行
     */
    methods: {
      columnStyle({ row, column, rowIndex, columnIndex }) {
        if (columnIndex === 0) {
          return 'background:	#FFF8DC;'
        }
      },
      back(){
        this.$router.back()
      },
      getSearchPage() {
        this.logining = true
        let url = this.$global.javaUrl+"/dataCleanResult/detail"
        let config = {
          headers:
            {
              //'Content-Type':'application/json',
              'user' : localStorage.getItem('userId')
            },
          params: {
            taskId:this.formInline.taskId,
            id:this.formInline.id,
            //isLock: this.formInline.isLock
          }
        }

        axios.get(url, config).then(response=>{

          this.ret = [{sourceContent:response.data.data.sourceContent,
            resultContent:response.data.data.resultContent ,
          }]
          const rows = response.data.data;
          const keys = Object.keys(rows);

          for (let i = 0; i < keys.length; i++) {
            console.log(keys[i], rows[keys[i]]);
          }
            if(this.$route.query.resultId ==response.data.data.resultId){
              this.sourceContent = response.data.data.sourceContent
              this.algorithmId = response.data.data.algorithmId
              this.resultContent = response.data.data.resultContent
            }
        })
      },
      // 分页插件事件
      callFather(parm) {
        this.formInline.page = parm.currentPage
        this.formInline.limit = parm.pageSize
        this.getdata(this.formInline)
      },

    }
  }
</script>

<style scoped>
  .user-search {
    margin-top: 20px;
  }
  .userRole {
    width: 100%;
  }


</style>

